package cn.zz.veggie.application.packer;

import cn.zz.comm.core.types.IdNameObj;
import cn.zz.veggie.model.domain.Shop;
import cn.zz.veggie.web.types.vo.mgmt.shop.MgmtShopVo;

/**
 * @author zhongq
 * @since 2024/7/28
 */
public class ShopPacker {

	public static IdNameObj toIdName(Shop shop) {
		return new IdNameObj(shop.getId(), shop.getName());
	}

	public static MgmtShopVo toMgmtShopVo(Shop shop) {
		final MgmtShopVo vo = new MgmtShopVo();
		vo.setId(shop.getId());
		vo.setName(shop.getName());
		vo.setAddress(shop.getAddress());
		vo.setMobile(shop.getMobile());
		vo.setCreatedAt(shop.getCreatedAt());
		vo.setUpdatedAt(shop.getUpdatedAt());
		return vo;
	}
}